Skip to content

test(storybook): long-text and narrow-width SelectableCard stories - #14044

Merged
cixzhang merged 1 commit into
mainfrom
l0/selectable-card-long-text-narrow-stories
Nov 29, 2026
Merged

cixzhang merged 1 commit into
mainfrom
l0/selectable-card-long-text-narrow-stories

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

SelectableCard had no story with long text and none at a narrow width, so a regression in how card text wraps, or in how the selection ring and padding look on a small card, had no story to show it and no visual-gate coverage. A maintainer changing Card, Text or SelectableCard could break those cases without a signal.

Intended invariant

The component itself is unchanged. The visual gate covers tagged Core stories (.github/scripts/visual-gate/README.md, "Coverage and results"): a visual-baseline tag adds the story to the canonical plan in the default theme, as a light and a dark key.

Change

apps/storybook/stories/SelectableCard.stories.tsx gains two stories:

  • Long Text (core-selectablecard--long-text): two 260px cards with long labels and descriptions that wrap; one label holds an unbroken word, which breaks across lines; one card is selected.
  • Narrow Width (core-selectablecard--narrow-width): two 120px cards in a column, as in a side panel; one is selected.

Both use the same multi-select state as the existing stories and carry tags: ['visual-baseline']. As with the other newly tagged stories, their baseline images are added through the visual gate's explicit full-plan maintenance, not in this pull request.

Evidence

  • Failure before the change: no SelectableCard story had long text or a narrow width (core-selectablecard--* lists single-select, multi-select, color-variants, with-nested-button and disabled).
  • Success after the change: both stories build and render in Chromium in the neutral theme (light and dark), the probe theme, and under forced colors, with no console errors. No card overflows horizontally (scrollWidth equals clientWidth). The selected card shows its ring, and under forced colors its 2px Highlight ring.
  • Product/runtime behavior verified unchanged: no package code changes; SelectableCardForcedColors.a11y.chromium.spec.ts (8/8) and SelectableCardAudit.a11y.chromium.spec.ts (7/7) pass against the new Storybook build.
  • CI impact: none to workflows. The canonical visual plan gains four keys (each story in light and dark) when this merges; the release check lists them as added until baseline maintenance accepts their images.

Scope

Components: SelectableCard (stories only)

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Overlap checked: #14031, #14029, #14039 (#14031 tagged the Disabled story in the same file and is merged; #14029 is the merged forced-colors ring these stories also show; #14039 is the forced-colors follow-up issue, which changes no story)

Testing

  • pnpm build, pnpm storybook:build, and the Storybook typecheck (tsc --noEmit) pass; Prettier and ESLint are clean on the stories file.
  • Chromium (Playwright) renders of both stories in neutral light and dark, probe light, and neutral under forced colors.
  • pnpm visual:plan runs.
  • node scripts/release/changeset-coverage.mjs pr: nothing here ships to consumers, so no changeset.

Adds a Long Text story (long labels and descriptions that wrap, and one
unbroken word that breaks across lines) and a Narrow Width story (cards at
120px, as in a side panel). Both carry the visual-baseline tag, so the
visual gate covers wrapping and the selection ring at small sizes.
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 29, 2026 8:35pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 29, 2026
@astracat-bot

astracat-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 29, 2026, 11:21 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 5ae36ec

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5ae36ec

Storybook · Sandbox · built from this PR's head

Not run on this PR: add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the two stories look right, but the description still misstates their visual-gate impact and needs one edit before approval.

  • The description says a visual-baseline tag adds one default-theme key per story and that the visual plan gains two keys when the baseline is next refreshed, but the plan captures each tagged story in Neutral light and dark (.github/scripts/visual-gate/lib/plan.mjs:679-692), so the canonical plan gains four keys as soon as this merges and release checks list them as added until full-plan baseline maintenance accepts them; please reword both sentences.

No code change is needed. CI has not run on this head yet because the pull request is a draft.

Claims and files checked

Review mode: same-head; reason: none

  • Live title "test(storybook): long-text and narrow-width SelectableCard stories": verified (the stories file adds Long Text and Narrow Width).
  • No earlier SelectableCard story had long text or a narrow width, and the existing stories were single-select, multi-select, color-variants, with-nested-button and disabled: verified (base story exports; one-line labels; the narrowest card is 140px).
  • The component is unchanged and no package code changes: verified (the stories file is the only changed path).
  • A visual-baseline tag adds one default-theme key for the story: false (each tagged story adds a light and a dark key, plan.mjs:679-692, plan.mjs:992-994).
  • Long Text shows two 260px cards whose text wraps, an unbroken word that breaks across lines, and one selected card: verified (story code; untruncated Text wraps with break-word, packages/core/src/Text/text.stylex.ts:240-250).
  • Narrow Width shows two 120px cards in a column with one selected: verified (story code).
  • Both stories use the same multi-select state as the existing stories: verified (the same Set toggle as the Multi-Select story).
  • Both stories carry the visual-baseline tag, and their baselines come later through full-plan maintenance as for other newly tagged stories: verified (visual-gate README, "Coverage and results"; the tagged Disabled story has no baseline shot yet).
  • Chromium renders in light, dark, probe and forced colors show no overflow, console error or missing ring: reported.
  • The forced-colors (8/8) and audit (7/7) browser specs pass: reported (CI has not run at this head).
  • No workflow changes: verified.
  • The visual plan gains two default-theme keys when the baseline is next refreshed: false (four keys enter the canonical plan at merge; gate.mjs:72, gate.mjs:235, plan.mjs:679-692).
  • Build, Storybook build, typecheck, Prettier and ESLint pass, and the visual plan command runs: reported.
  • No changeset is needed: verified (scripts/release/changeset-coverage.mjs:285-301 treats private packages and stories as not shipped).
  • No public API, product behavior, visual direction or policy change: verified.
  • Public text contains no internal context: verified.
  • Overlap with #14031, #14029 and #14039: verified (two merged pull requests and one open issue).
  • Rules changed since the earlier review (0): none.
  • File: apps/storybook/stories/SelectableCard.stories.tsx: clear; the finding is in the description only.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. CI has passed on this head.

The two stories match their description: Long Text's cards wrap long labels and break the unbroken word inside the card, Narrow Width stacks two 120px cards, and both join the canonical visual plan as four default-theme keys (light and dark per story) at merge, listed as added until baseline maintenance accepts them. No changes are needed.

Claims and files checked

Review mode: same-head; reason: none

  • Live title "test(storybook): long-text and narrow-width SelectableCard stories": verified (the stories file adds Long Text and Narrow Width).
  • No earlier SelectableCard story had long text or a narrow width: reported (the five earlier stories use one-line labels; the narrowest are Color Variants' 140px one-word cards).
  • The component is unchanged and no package code changes: verified (the stories file is the only changed path).
  • A visual-baseline tag adds a story to the canonical plan as a light and a dark default-theme key: verified (.github/scripts/visual-gate/lib/plan.mjs:40, :679-693; visual gate README, "Coverage and results").
  • Long Text shows two 260px cards whose long labels and descriptions wrap, one unbroken word that breaks across lines, and one selected card: verified (story code; untruncated Text wraps with break-word, packages/core/src/Text/text.stylex.ts:240-250, and the Text reflow browser spec covers the inline case).
  • Narrow Width shows two 120px cards in a column with one selected: verified (story code).
  • Both stories use the same multi-select state as the existing stories: verified (the same Set toggle as One Selected Card, Multi-Select and Color Variants).
  • Both stories carry the visual-baseline tag, and their baseline images come later through full-plan maintenance: verified (no baseline change here; visual gate README).
  • Chromium renders in light, dark, probe and forced colors show no console error, no horizontal overflow and the selection ring: reported.
  • The forced-colors browser spec passes 8 of 8: verified (CI at this head); the audit browser spec passes 7 of 7: reported.
  • No workflow changes: verified.
  • The canonical visual plan gains four keys at merge and the release check lists them as added until baseline maintenance accepts them: verified (lib/plan.mjs:679-693; lib/compare.mjs:125-128, :269-278).
  • Build, Storybook build, typecheck, Prettier and ESLint pass: verified (CI at this head); the visual plan command runs: reported.
  • No changeset is needed: verified (scripts/release/changeset-coverage.mjs:286-292 treats the private Storybook app as not shipped).
  • No public API, product behavior, visual direction or policy change: verified.
  • Public text contains no internal context: verified.
  • Overlap with #14031, #14029 and #14039: verified (two merged pull requests and a closed issue).
  • changed rules (0): none.
  • File apps/storybook/stories/SelectableCard.stories.tsx: clear.

Automated review (maintainer link)

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 29, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 29, 2026 23:02
@cixzhang
cixzhang merged commit 7955ed8 into main Nov 29, 2026
149 checks passed
cixzhang added a commit that referenced this pull request Nov 30, 2026
…ht from one capture

Lane 0's #14044 merged after capture run 46320468653, adding four SelectableCard keys (Long text, Narrow width). All eight keys are now accepted from main capture run 46325077823 (7955ed8), which holds both #14046 and #14044: the manifest is reset to main's and gate.mjs accept runs once per group.
cixzhang added a commit that referenced this pull request Nov 30, 2026
CodeBunny on 8a8e0ac: in Narrow width only the descriptions wrap, and the Long text title ends in an unbroken word. gate.mjs accept is re-run from main's manifest and the same capture with that reason. Frames unchanged.
cixzhang added a commit that referenced this pull request Nov 30, 2026
 added (#14050)

* test(visual): accept the probe Disabled SelectableCard and Neutral ThemeAddedVariant Card shots

gate.mjs accept from main capture run 46320468653 (dea3ad6e) for the four keys #14046 added: core-selectablecard--disabled__probe-light/-dark and core-card--theme-added-variant__neutral-light/-dark.

* test(visual): also accept #14044's SelectableCard shots; take all eight from one capture

Lane 0's #14044 merged after capture run 46320468653, adding four SelectableCard keys (Long text, Narrow width). All eight keys are now accepted from main capture run 46325077823 (7955ed8), which holds both #14046 and #14044: the manifest is reset to main's and gate.mjs accept runs once per group.

* test(visual): the #14044 accept record says what its frames show

CodeBunny on 8a8e0ac: in Narrow width only the descriptions wrap, and the Long text title ends in an unbroken word. gate.mjs accept is re-run from main's manifest and the same capture with that reason. Frames unchanged.
@github-actions
github-actions Bot deleted the l0/selectable-card-long-text-narrow-stories branch November 30, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 5ae36ec9 Deployed Nov 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant